package com.itheima.a04threadmethod1;

public class ThreadDemo1 {
    public static void main(String[] args) throws InterruptedException {

        //创建线程对象
        MyThread t = new MyThread();
        //启动线程
        t.start();
        //获取创建线程对象线程名称
        System.out.println(t.getName());
        //该线程休眠2000毫秒
        Thread.sleep(2000);
        //获取当前线程对象
        System.out.println(Thread.currentThread());
        //获取当前线程对象线程名称
        System.out.println(Thread.currentThread().getName());


    }
}
